package com.kyc.kycxkplaygame.activity.digital;

import android.app.Activity;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import com.kyc.kycxkplaygame.R;
import com.kyc.kycxkplaygame.entity.digital.DigitalBlockUnit;
import com.kyc.kycxkplaygame.view.digital.DigitalBgView;
import com.kyc.kycxkplaygame.view.digital.DigitalMoveRectView;
import com.kyc.kycxkplaygame.view.digital.MoveTextView;
import com.zhy.android.percent.support.PercentRelativeLayout;

import java.util.List;

public class DigitalMainActivity extends Activity {

    private RecyclerView recycle;
    private PercentRelativeLayout layout_movetxt;
    private MoveTextView move_txt_01;
    private DigitalMoveRectView digital_move_txt;
    private DigitalBgView digitalbg;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_digital_main);

       /* List<String> list = new ArrayList<>();
        list.add("1");
        list.add("2");
        list.add("1");
        list.add("0");
        list.add("0");

        recycle = findViewById(R.id.recycle);
        //linearLayoutManager = new LinearLayoutManager(getContext());
        GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 5);
        recycle.setLayoutManager(gridLayoutManager);
        recycle.addItemDecoration(new GridSpacingItemDecoration(8, 0, false));
        recycle.setItemAnimator(new DefaultItemAnimator());
        DigtialMainAdapter digtialMainAdapter = new DigtialMainAdapter(this);
        digtialMainAdapter.setList(list);
        recycle.setAdapter(digtialMainAdapter);*/

       /* DigitalViewAW digital_view = findViewById(R.id.digital_view);
        digital_view.setFather(this);
        digital_view.startGame();*/

        digitalbg = findViewById(R.id.digitalbg);
        digital_move_txt = findViewById(R.id.digital_move_txt);
        digital_move_txt.setFather(this);
        digital_move_txt.startGame();
    }


    @Override
    public void onWindowFocusChanged(boolean hasFocus) {
        super.onWindowFocusChanged(hasFocus);
        digital_move_txt.setWidthAndHeight(digitalbg.getWidth(), digitalbg.getHeight());
        Log.i("KYCC","perlinlayout.getWidth() === " + digitalbg.getWidth()+" , perlinlayout.getHeight() === "+ digitalbg.getHeight());
    }

    public void setNextBlockView(List<DigitalBlockUnit> blockUnits, int div_x) {
        //nextBlockView.setBlockUnits(blockUnits, div_x);
    }
}
